<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="description" content="" />
        <meta name="keywords" content="" />
        <meta name="author" content="Flying hormone" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta charset="UTF-8">
        <link rel="stylesheet" href="../css/media.css" />
        <link rel="stylesheet" href="../css/mui.min.css" />
        <link rel="stylesheet" href="../css/head_foot.css" />
        <script type="text/javascript" src="../js/jquery-1.9.1.js"></script>
        <script type="text/javascript" src="../js/jquery.Query.js" ></script>
        <script type="text/javascript" src="../js/jquery-cookie.js"></script>
        <script type="text/javascript" src="../js/mui.min.js"></script>
        <script type="text/javascript" src="../js/appcan.js"></script>
        <script type="text/javascript" src="../js/appcan.control.js"></script>
        <script type="text/javascript" src="../js/common.js" ></script>
		<title>提问详情</title>
		<style>
            
            .xiangxia{ position: absolute; top: 0.3125em; right: 0.625em; z-index: 0; }
            .tu_2 img{
                width: 100%;
                padding: 0.625em 1em;
                background: #fff;
            }
            
            .same_city_search .mui-table-view-cell{ padding: 0.5em 1em;}
            .mui-media-body p{ font-size: 0.8em;}
            .huida i{position: absolute; top: 0.625em; right: 0.625em; font-style: normal; color: #999; border: 1px solid #ccc; padding: 0 0.375em; line-height: 1em; border-radius: 0.3125em;}
            .huida div>img{ width: 22%; height: 3em;}
            .huida p{ margin-bottom: 0.3125em;}
            .mui-table-view .mui-media-body{
                line-height: 1em;
            }
            .mui-table-view .mui-media-object {
                line-height: 3em;
                max-width: 3em;
                width: 3em;
                height: 3em;
                border-radius: 0.625em;
            }
            .mui-table-view .mui-media-object.mui-pull-left {
                margin-right: 0.5em;
            }
            .same_city_search .mui-table-view .mui-media-object {
                margin-right: 0.5em;
            }
            .xiangxi{ padding: 0.8em; }
            .xiangxi p{ padding-bottom: 1em;}
            .xiangxi p:first-child{ text-indent: 1.25em; font-size: 0.9em;}
            .xiangxi p:last-child{ font-size: 0.9em; text-align: right; margin-right: 1.25em; color: #ccc;}
        </style>
	</head>

	<body>
		<header>
			<a><span class="leftleft"></span></a>
			<h1>提问详情</h1>
		</header>
		<section class="same_city_search">
			<div>
				<ul class="mui-table-view" id="myMsg">
				</ul>
			</div>
		</section>
		
		<section class="huida">
			<div>
				<ul class="mui-table-view" id="myMsgReviewList">
				</ul>
			</div>
		</section>

		<footer>
			<nav class="mui-bar mui-bar-tab">
				<a href="javascript:;" id="tcIndex">
					<img src="../img/shouye2.png" />
					<span class="mui-tab-label">首页</span>
				</a>
				<a href="javascript:;" id="myfabu">
					<img src="../img/fabu2.png" />
					<span class="mui-tab-label">发布</span>
				</a>
				<a class="action" href="javascript:;" id="myInfo">
					<img src="../img/mine2.png" />
					<span class="mui-tab-label">我的</span>
				</a>
			</nav>
		</footer>
        <script>
            $(function(){
                var msgId = getVal("msgId");
                if(msgId!=""){
                    //问题详情
                    appcan.ajax({
                        type:"post",
                        async:false,       
                        url:host+"/getMsg.json?msgId="+msgId,
                        data:"",
                        dataType:"json",
                        contentType: "application/json",
                        success : function(dataResult) {
                            var data = dataResult.data;
                            var msgStr = "";
                            if(data!=null){
                                msgStr +='<li class="mui-table-view-cell mui-media">';
                                msgStr +='<a href="javascript:;">';
                                msgStr +='<img class="mui-media-object mui-pull-left" src="'+hostIp+data.picUrl+'">';
                                msgStr +='<div class="mui-media-body">';
                                msgStr +='<p class="mui-ellipsis">'+data.cardName+'</p>';
                                msgStr +='<p class="mui-ellipsis" style="color: #232323;font-size: 1em;">'+data.title+'</p>';
                                msgStr +='<i>'+data.createTime+'</i>';
                                msgStr +='</div>';
                                msgStr +='</a>';
                                msgStr +='</li>';
                                if(!!data.msgPic){
                                    var msgPics = data.msgPic.split(",");
                                    for (var j=0; j < msgPics.length; j++) {
                                      if(j==0)msgStr+='<li class="mui-table-view-cell mui-media">';
                                      msgStr +='<img style="width: 18%;height: 3em;" src="'+hostIp+msgPics[j]+'"/> ';
                                      if(j==msgPics.length-1)msgStr+='</li>';
                                    };
                                }
                                msgStr +='<div class="xiangxi">';
                                msgStr +='<p>'+data.remark+'</p>';
                                msgStr +='<p>需求地址：'+data.region+'  '+data.createTime+'</p>';
                                msgStr +='</div>';
                            }
                            $("#myMsg").html(msgStr);
                            
                        }
                    });
                    //回复列表
                    appcan.ajax({
                        type:"post",
                        async:false,       
                        url:host+"/getMsgReview.json?msgId="+msgId,
                        data:"",
                        dataType:"json",
                        contentType: "application/json",
                        success : function(dataResult) {
                            var dataList = dataResult.data;
                            var msgReviewStr = "";
                            if(dataList.length>0){
                                for(var i=0;i<dataList.length;i++){
                                    msgReviewStr +='<li class="mui-table-view-cell mui-media">';
                                    msgReviewStr +='<img class="mui-media-object mui-pull-left" src="'+hostIp+dataList[i].picUrl+'">';
                                    msgReviewStr +='<div class="mui-media-body">';
                                    msgReviewStr +=dataList[i].cardName;
                                    msgReviewStr +='<p class="mui-ellipsis">'+dataList[i].remark+'</p>';
                                    msgReviewStr +='<i class="cardInfo" data-id='+dataList[i].cardId+'>查看名片</i>';
                                    msgReviewStr +='<div>';
                                    if(!!dataList[i].msgPic && dataList[i].msgPic.length > 0){
                                        var msgPics = dataList[i].msgPic.split(",");
                                        for (var j=0; j < msgPics.length; j++) {
                                          msgReviewStr +='<img src="'+hostIp+msgPics[j]+'"/> ';
                                        };
                                    }
                                    msgReviewStr +='</div>';
                                    msgReviewStr +='</div>';
                                    msgReviewStr +='</li>';
                                }
                            }
                            $("#myMsgReviewList").html(msgReviewStr);
                        }
                    });
                }
                
                $(".cardInfo").click(function(){
                    var cardId = $(this).attr("data-id");
                    openUrl('../page/cardxiangqing.html?cardId='+cardId,'cardxiangqing');
                })
            })
        </script>
	</body>
</html>